/****************
Analysis file for 
"Human Rights versus National Interests: Shifting US Public Attitudes on the International Criminal Court"
by Kelebogile Zvobgo
*****************/	



clear all
set more off
capture log close
cap cd "/Users/kelebogilezvobgo/Desktop/Research/1_ICC-Public-Opinion/ISQ_FINAL/Data"
log using "HR-versus-NI_ISQ-Replication_Log-File.log", replace
use "HR-versus-NI_ISQ-Replication_Data.dta", clear
pause on



***
* Summary Statistics
***

*This makes Table 2: Summary Statistics of Participant Characteristics
tabstat  hr_only ni_only competitive information support_join_court ///
finance_court icc_previous race_1 gender party_2 party_1 college under_40, stat(mean min max n) col(stat)



***
* Treatment Effects (Difference in Means)
***

* This makes the main treatment table, Table 3: Approval Rates by Treatment Group for Join Court
bysort treat_group: su support_join_court /* for columns 2, 3, 5*/
reg support_join_court hr if treat_group==2 | treat_group == 1 /* for table columns 4, 6, 7*/
reg support_join_court ni if treat_group==3 | treat_group == 1 /* for table columns 4, 6, 7*/
reg support_join_court competitive if treat_group==4 | treat_group == 1 /* for table columns 4, 6, 7*/



***
* Figures
***

* This makes Figure 2: Rationale for ICC Support/Opposition, All Respondents, DV = Join Court
twoway (histogram reason if support_join_court_p==1, percent color(gs10)) ///
       (histogram reason if support_join_court_p==2, percent ///
	   fcolor(none) lcolor(black)), legend(order(2 "Oppose" 1 "Support" )) ///
	   graphregion(fcolor(white)) 

	   
* These make Figure 3: Rationale for ICC Support/Opposition by Treatment Group, All Respondents, DV = Join Court
* Human Rights/Control
twoway (histogram reason if hr_p==1, percent color(gs10)) ///
       (histogram reason if hr_p==2, percent ///
	   fcolor(none) lcolor(black)), legend(order(2 "Control" 1 "Human Rights" )) ///
	   graphregion(fcolor(white))
* National Interest/Control     
twoway (histogram reason if ni_p==1, percent color(gs10)) ///
       (histogram reason if ni_p==2, percent ///
	   fcolor(none) lcolor(black)), legend(order(2 "Control" 1 "National Interest" )) ///
	   graphregion(fcolor(white)) 
* Competitive/Control  
twoway (histogram reason if competitive_p==1, percent color(gs10)) ///
       (histogram reason if competitive_p==2, percent ///
	   fcolor(none) lcolor(black)), legend(order(2 "Control" 1 "Competitive" )) ///
	   graphregion(fcolor(white)) 
	   
	   
* This makes Figure 4a: Join Court by Information
twoway (histogram join_court if information_p==1, percent color(gs10)) ///
       (histogram join_court if information_p==2, percent ///
	   fcolor(none) lcolor(black)), legend(order(2 "No Information" 1 "Information" )) ///
	   graphregion(fcolor(white))

* This makes Figure 4b: Join Court by Prior Knowledge
twoway (histogram join_court if knowledge_p==1, percent color(gs10)) ///
       (histogram join_court if knowledge_p==2, percent ///
	   fcolor(none) lcolor(black)), legend(order(2 "No Prior Knowledge" 1 "Prior Knowledge")) ///
	   graphregion(fcolor(white))


	  
***
* Setting Global Controls for Regression Analysis
***

* Treatments
global treatments hr_only ni_only competitive information

* Party_ID
global party party_2 party_1 

* Demographics
global demographics race_1 gender $party college under_40

* IO attitudes
global io io_use io_go io_eff io_bi

* UN attitudes
global un un_use un_go un_eff  un_bi

* World Affairs Knowledge
global world_affairs icc_previous reads_news watches_news

* IO Interactions
global io_interactions io_use hr_io_use ni_io_use competitive_io_use ///
io_go hr_io_go ni_io_go competitive_io_go ///
io_eff hr_io_eff ni_io_eff competitive_io_eff ///
io_bi hr_io_bi ni_io_bi competitive_io_bi

* UN Interactions
global un_interactions un_use hr_un_use ni_un_use competitive_un_use ///
un_go hr_un_go ni_un_go competitive_un_go ///
un_eff hr_un_eff ni_un_eff competitive_un_eff ///
un_bi hr_un_bi ni_un_bi competitive_un_bi

* World Affairs Interactions
global wa_interactions hr_icc_previous ni_icc_previous competitive_icc_previous ///
hr_reads_news  ni_reads_news competitive_reads_news ///
hr_watches_news ni_watches_news competitive_watches_news



***
* Regression Analysis: Main Models (see Table 4 in main text)
***

eststo clear

eststo: logit support_join_court $treatments
eststo: logit support_join_court $treatments $demographics
eststo: logit support_join_court $treatments $demographics $world_affairs 
eststo: logit support_join_court $treatments $demographics $world_affairs $io 
eststo: logit support_join_court $treatments $demographics $world_affairs $un 
esttab using main.tex, replace label b(3) se(2) nomtitles /*
*/ title("Framing Effects on Court Membership Opinion") star(+ 0.10 * 0.05 ** 0.01 *** 0.001)  


eststo A: logit support_join_court $treatments $demographics $world_affairs $io 
coefplot A, xline(0) xtitle(Coefficients) drop(_cons) graphregion(fcolor(white)) msymbol(d) mfcolor(gs16)


eststo B: logit support_join_court $treatments $demographics $world_affairs $un 
coefplot B, xline(0) xtitle(Coefficients) drop(_cons) graphregion(fcolor(white)) msymbol(d) mfcolor(gs16)



***
* Interaction Models (see Tables A2-A4 in supplementary appendix)
***

* IO attitudes
eststo clear
eststo: logit support_join_court $treatments
eststo: logit support_join_court $treatments $demographics
eststo: logit support_join_court $treatments $demographics $world_affairs 
eststo: logit support_join_court $treatments $demographics $world_affairs $io 
eststo: logit support_join_court $treatments $demographics $world_affairs $io_interactions 
esttab using io_interactions.tex, replace label se nomtitles /*
*/ title("Interaction of Treatments and IO Attitudes") star(+ 0.10 * 0.05 ** 0.01 *** 0.001)  

* UN attitudes
eststo clear
eststo: logit support_join_court $treatments
eststo: logit support_join_court $treatments $demographics
eststo: logit support_join_court $treatments $demographics $world_affairs 
eststo: logit support_join_court $treatments $demographics $world_affairs $un 
eststo: logit support_join_court $treatments $demographics $world_affairs $un_interactions
esttab using un_interactions.tex, replace label se nomtitles /*
*/ title("Interaction of Treatments and UN Attitudes") star(+ 0.10 * 0.05 ** 0.01 *** 0.001)  

* World Affairs Knowledge
eststo clear
eststo: logit support_join_court $treatments
eststo: logit support_join_court $treatments $demographics
eststo: logit support_join_court $treatments $demographics $world_affairs 
eststo: logit support_join_court $treatments $demographics $world_affairs $wa_interactions 
esttab using wa_interactions.tex, replace label se nomtitles /*
*/ title("Interaction of Treatments and World Affairs Knowledge") star(+ 0.10 * 0.05 ** 0.01 *** 0.001)  



***
* Secondary Assessment, DV = Finance Court
***

* This makes Table A1 Approval Rates by Treatment Group for Finance Court
bysort treat_group: su finance_court 
reg finance_court hr if treat_group==2 | treat_group == 1
reg finance_court ni if treat_group==3 | treat_group == 1
reg finance_court competitive if treat_group==4 | treat_group == 1



***
* Attitudinal DVs (see supplementary appendix)
***

* Call Senator (Table A5)
bysort treat_group: su call 
reg call hr if treat_group==2 | treat_group == 1 
reg call ni if treat_group==3 | treat_group == 1
reg call competitive if treat_group==4 | treat_group == 1



***
* Behavioral DV: Call Senator (see supplementary appendix)
***

* Donate (Table A6)
bysort treat_group: su donate 
reg donate hr if treat_group==2 | treat_group == 1 
reg donate ni if treat_group==3 | treat_group == 1
reg donate competitive if treat_group==4 | treat_group == 1

* Write Senator (Table A7)
bysort treat_group: su write_senator 
reg write_senator hr if treat_group==2 | treat_group == 1 
reg write_senator ni if treat_group==3 | treat_group == 1
reg write_senator competitive if treat_group==4 | treat_group == 1

* Letter Type (Table A8)
bysort treat_group: su letter_support 
reg letter_support hr if treat_group==2 | treat_group == 1 
reg letter_support ni if treat_group==3 | treat_group == 1
reg letter_support competitive if treat_group==4 | treat_group == 1
